package com.lanou.mapper;

import com.lanou.bean.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DiaryMapper {
    void insertDiary(@Param("writeDiary") String writeDiary,
                     @Param("stage") String stage,
                     @Param("diaryLabel") String diaryLabel,
                     @Param("date") String date);

    Integer selectDiaryId(@Param("date") String date);

    void insertDiaryFinishOrder(@Param("productName") String productName,
                                @Param("price") String price,
                                @Param("count") String count,
                                @Param("brand") String brand,
                                @Param("buyAddress") String buyAddress,
                                @Param("style") String style,
                                @Param("classes") String classes,
                                @Param("remark") String remark,
                                @Param("diaryId") Integer diaryId);

    void  insertDiaryPhoto(@Param("photoUrl") String photoUrl,
                           @Param("diaryId") Integer diaryId);


    void insertNewDiary(@Param("userId") Integer userId,
                        @Param("diaryTitle") String diaryTitle,
                        @Param("houserType") String houserType,
                        @Param("area") String area,
                        @Param("city") String city,
                        @Param("style") String style,
                        @Param("decorateWay") String decorateWay,
                        @Param("villageName") String villageName,
                        @Param("companyName") String companyName);

    void insertDiaryComments(@Param("userNick")String userNick,@Param("headImg")String headImg,
                             @Param("commentContent")String commentContent,@Param("diary_id")
                                     Integer diary_id,@Param("commentTime") String commentTime );
    CommentUser selectUser(@Param("phone")String phone);

    void insertRepeatContent(@Param("repeaterNick")String repeaterNick,@Param("repeaterImg")String repeaterImg,
                             @Param("repeatContent")String repeatContent,@Param("repeatToUserNick")
                             String repeatToUserNick,@Param("commenter_id")Integer commenter_id);

    List<DiaryRepeat> getDiaryRepeat(@Param("commenter_id")Integer commenter_id);

    List<DiaryComments> getDiaryComments(@Param("di_id") Integer di_id);

    User selectAllDiary();



    List<Diary> getAllDiary(Integer id);

    List<DiaryComments> getDiaryCommentsById(Integer id);

    List<DiaryRepeat> getDiaryRepeatById(Integer id);

    Integer countComment(Integer dndId);

    List<DiaryFinishOrder> getDiaryFinishOrderId(Integer id);

    List<DiaryPhoto> getPhotosById(Integer id);

    double sumPrice(Integer id);
}